package com.example.maggie.meizinote.mvp.listener;

import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.webkit.JavascriptInterface;

import com.example.maggie.meizinote.mvp.ui.activity.BigImageActivity;

/**
 * Created by addis on 2018/4/29.
 */
public class EditJavaScriptInterface {
    private Context context;

    public EditJavaScriptInterface(Context context) {
        this.context = context;
    }

    //点击图片回调方法
    //必须添加注解,否则无法响应
    @JavascriptInterface
    public void openImage(String img) {
        Log.i("TAG", "响应点击事件!");
        Intent intent = new Intent();
        intent.putExtra("image", img);
        intent.setClass(context, BigImageActivity.class);//BigImageActivity查看大图的类，自己定义就好
        context.startActivity(intent);
    }
}
